
/*==========================================[ STUB tool functions ]===========================================================================*/

int uninstall_stub(void* stub_f);
int install_stub(void *orig_f, void *stub_f, char *desc);
#define INSTALL_STUB(o,s) install_stub((void*)o,(void*)s,(char*)#o"->"#s)
#define REMOVE_STUB(s) uninstall_stub((void*)s)
typedef struct list_head
{
    struct list_head *next, *prev;
 
}list_head_t;
 
#define LIST_HEAD_INIT(name) { &(name),&(name) }
#define LIST_HEAD(name) \
struct list_head name = LIST_HEAD_INIT(name)
 
#define INIT_LIST_HEAD(ptr) do { \
(ptr)->next = (ptr);(ptr)->prev = (ptr);\
} while (0)
 
#define list_entry(ptr,type,member) \
   ((type*)((char*)(ptr)-(unsigned long)(&((type*)0)->member)))
#define list_for_each(pos,head) \
for(pos=(head)->next;pos!=(head);pos=pos->next)
 
/*====================================================================================================================*/
